type lastArr1 = ['a', 'b', 'c']
type lastArr2 = [3, 2, 1]

type tail1 = LastOfArray<lastArr1> // expected to be 'c'
type tail2 = LastOfArray<lastArr2> // expected to be 1

type LastOfArray<T> = T extends [...unknown[], infer R] ? R : never; 